package io.gitee.twoke.generator.engine.impl.persistence.entity.data.impl;

import io.gitee.twoke.generator.engine.impl.cfg.GenerateEngineConfigurationImpl;
import io.gitee.twoke.generator.engine.impl.persistence.PropertyDataManager;
import io.gitee.twoke.generator.engine.impl.persistence.entity.AbstractDataManager;
import io.gitee.twoke.generator.engine.impl.persistence.entity.PropertyEntity;
import io.gitee.twoke.generator.engine.impl.persistence.entity.PropertyEntityImpl;

import java.util.List;

public class MybatisPropertyDataManager extends AbstractDataManager<PropertyEntity> implements PropertyDataManager {
  
  public MybatisPropertyDataManager(GenerateEngineConfigurationImpl generateEngineConfiguration) {
    super(generateEngineConfiguration);
  }

  @Override
  public Class<? extends PropertyEntity> getManagedEntityClass() {
    return PropertyEntityImpl.class;
  }
  
  @Override
  public PropertyEntity create() {
    return new PropertyEntityImpl();
  }
  
  @Override
  @SuppressWarnings("unchecked")
  public List<PropertyEntity> findAll() {
    return getDbSqlSession().selectList("selectProperties");
  }
  
}